cmake_minimum_required(VERSION 3.5)
project(landmark)

# 1. 核心构建系统与依赖声明
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
##
find_package(cartographer_ros_msgs REQUIRED)
find_package(param_space REQUIRED)



# 3. 头文件包含
include_directories(include)

# 4. 定义可执行文件及依赖
add_executable(pub_landmark src/pub_landmark_ros2.cpp)
ament_target_dependencies(pub_landmark
  rclcpp
  std_msgs
  sensor_msgs
  cartographer_ros_msgs
  param_space
  visualization_msgs
  geometry_msgs
)

add_executable(tcp_server_node src/tcp_server_node_ros2.cpp)
ament_target_dependencies(tcp_server_node
  rclcpp
  cartographer_ros_msgs
  std_msgs
)

# 5. 安装规则（ROS2标准路径）
install(TARGETS 
  pub_landmark 
  tcp_server_node
  DESTINATION lib/${PROJECT_NAME}
)

# 6. 导出依赖
ament_export_dependencies(
  rclcpp
  std_msgs
  sensor_msgs
  visualization_msgs
)

# 7. 必须的收尾调用
ament_package()
